﻿using System;
using System.Diagnostics;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using HslCommunication.BasicFramework;
using HslCommunication.Core;
using HslCommunication.Core.IMessage;
using HslCommunication.Core.Net;
using HslCommunication.LogNet;
using HslCommunication.Reflection;
using Newtonsoft.Json;

namespace HslCommunication.Robot.FANUC
{
	/// <summary>
	/// Fanuc机器人的PC Interface实现，在R-30iB mate plus型号上测试通过，支持读写任意的数据，写入操作务必谨慎调用，写入数据不当造成生命财产损失，作者概不负责。读写任意的地址见api文档信息<br />
	/// The Fanuc robot's PC Interface implementation has been tested on R-30iB mate plus models. It supports reading and writing arbitrary data. The writing operation must be called carefully. 
	/// Improper writing of data will cause loss of life and property. The author is not responsible. Read and write arbitrary addresses see api documentation information
	/// </summary>
	/// <remarks>
	/// 如果使用绝对地址进行访问的话，支持的地址格式如下：
	/// <list type="table">
	///   <listheader>
	///     <term>地址名称</term>
	///     <term>地址代号</term>
	///     <term>示例</term>
	///     <term>地址进制</term>
	///     <term>字操作</term>
	///     <term>位操作</term>
	///     <term>备注</term>
	///   </listheader>
	///   <item>
	///     <term>数据寄存器</term>
	///     <term>D</term>
	///     <term>D100,D200</term>
	///     <term>10</term>
	///     <term>√</term>
	///     <term>×</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>输入寄存器</term>
	///     <term>AI</term>
	///     <term>AI100,AI200</term>
	///     <term>10</term>
	///     <term>√</term>
	///     <term>×</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>输出寄存器</term>
	///     <term>AQ</term>
	///     <term>AQ100,Q200</term>
	///     <term>10</term>
	///     <term>√</term>
	///     <term>×</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>输入继电器</term>
	///     <term>I</term>
	///     <term>I100,I200</term>
	///     <term>10</term>
	///     <term>×</term>
	///     <term>√</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>输出继电器</term>
	///     <term>Q</term>
	///     <term>Q100,Q200</term>
	///     <term>10</term>
	///     <term>×</term>
	///     <term>√</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>中间继电器</term>
	///     <term>M</term>
	///     <term>M100,M200</term>
	///     <term>10</term>
	///     <term>×</term>
	///     <term>√</term>
	///     <term></term>
	///   </item>
	/// </list>
	/// </remarks>
	/// <example>
	/// 我们先来看看简单的情况
	/// <code lang="cs" source="HslCommunication_Net45.Test\Documentation\Samples\Robot\FANUC\FanucInterfaceNetSample.cs" region="Sample1" title="简单的读取" />
	/// 读取fanuc部分数据
	/// <code lang="cs" source="HslCommunication_Net45.Test\Documentation\Samples\Robot\FANUC\FanucInterfaceNetSample.cs" region="Sample2" title="属性读取" />
	/// 最后是比较高级的任意数据读写
	/// <code lang="cs" source="HslCommunication_Net45.Test\Documentation\Samples\Robot\FANUC\FanucInterfaceNetSample.cs" region="Sample3" title="复杂读取" />
	/// </example>
	// Token: 0x02000035 RID: 53
	public class FanucInterfaceNet : NetworkDeviceBase, IRobotNet, IReadWriteNet
	{
		/// <summary>
		/// 实例化一个默认的对象<br />
		/// Instantiate a default object
		/// </summary>
		// Token: 0x0600041D RID: 1053 RVA: 0x000101DC File Offset: 0x0000E3DC
		public FanucInterfaceNet()
		{
			base.WordLength = 1;
			base.ByteTransform = new RegularByteTransform();
		}

		/// <summary>
		/// 指定ip及端口来实例化一个默认的对象，端口默认60008<br />
		/// Specify the IP and port to instantiate a default object, the port defaults to 60008
		/// </summary>
		/// <param name="ipAddress">ip地址</param>
		/// <param name="port">端口号</param>
		// Token: 0x0600041E RID: 1054 RVA: 0x00010278 File Offset: 0x0000E478
		public FanucInterfaceNet(string ipAddress, int port = 60008)
		{
			base.WordLength = 1;
			this.IpAddress = ipAddress;
			this.Port = port;
			base.ByteTransform = new RegularByteTransform();
		}

		/// <inheritdoc />
		// Token: 0x0600041F RID: 1055 RVA: 0x00010321 File Offset: 0x0000E521
		protected override INetMessage GetNewNetMessage()
		{
			return new FanucRobotMessage();
		}

		/// <summary>
		/// 获取或设置当前客户端的ID信息，默认为1024<br />
		/// Gets or sets the ID information of the current client. The default is 1024.
		/// </summary>
		// Token: 0x170000DA RID: 218
		// (get) Token: 0x06000420 RID: 1056 RVA: 0x00010328 File Offset: 0x0000E528
		// (set) Token: 0x06000421 RID: 1057 RVA: 0x00010330 File Offset: 0x0000E530
		public int ClientId { get; private set; } = 1024;

		/// <summary>
		/// 获取或设置缓存的Fanuc数据的有效时间，对<see cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadString(System.String)" />方法有效，默认为100，单位毫秒。也即是在100ms内频繁读取机器人的属性数据的时候，优先读取缓存值，提高读取效率。<br />
		/// Gets or sets the valid time of the cached Fanuc data. It is valid for the <see cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadString(System.String)" /> method. The default is 100, in milliseconds. 
		/// That is, when the attribute data of the robot is frequently read within 100ms, the cache value is preferentially read to improve the reading efficiency.
		/// </summary>
		// Token: 0x170000DB RID: 219
		// (get) Token: 0x06000422 RID: 1058 RVA: 0x00010339 File Offset: 0x0000E539
		// (set) Token: 0x06000423 RID: 1059 RVA: 0x00010341 File Offset: 0x0000E541
		public int FanucDataRetainTime { get; set; } = 100;

		// Token: 0x06000424 RID: 1060 RVA: 0x0001034C File Offset: 0x0000E54C
		private OperateResult ReadCommandFromRobot(Socket socket, string[] cmds)
		{
			for (int i = 0; i < cmds.Length; i++)
			{
				byte[] bytes = Encoding.ASCII.GetBytes(cmds[i]);
				OperateResult<byte[]> operateResult = this.ReadFromCoreServer(socket, FanucHelper.BuildWriteData(56, 1, bytes, bytes.Length), true, true);
				bool flag = !operateResult.IsSuccess;
				if (flag)
				{
					return operateResult;
				}
			}
			return OperateResult.CreateSuccessResult();
		}

		/// <inheritdoc />
		// Token: 0x06000425 RID: 1061 RVA: 0x000103B4 File Offset: 0x0000E5B4
		protected override OperateResult InitializationOnConnect(Socket socket)
		{
			BitConverter.GetBytes(this.ClientId).CopyTo(this.connect_req, 1);
			OperateResult<byte[]> operateResult = this.ReadFromCoreServer(socket, this.connect_req, true, true);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				operateResult = this.ReadFromCoreServer(socket, this.session_req, true, true);
				bool flag2 = !operateResult.IsSuccess;
				if (flag2)
				{
					result = operateResult;
				}
				else
				{
					result = this.ReadCommandFromRobot(socket, FanucHelper.GetFanucCmds());
				}
			}
			return result;
		}

		// Token: 0x06000426 RID: 1062 RVA: 0x0001042C File Offset: 0x0000E62C
		[DebuggerStepThrough]
		private Task<OperateResult> ReadCommandFromRobotAsync(Socket socket, string[] cmds)
		{
			FanucInterfaceNet.<ReadCommandFromRobotAsync>d__13 <ReadCommandFromRobotAsync>d__ = new FanucInterfaceNet.<ReadCommandFromRobotAsync>d__13();
			<ReadCommandFromRobotAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<ReadCommandFromRobotAsync>d__.<>4__this = this;
			<ReadCommandFromRobotAsync>d__.socket = socket;
			<ReadCommandFromRobotAsync>d__.cmds = cmds;
			<ReadCommandFromRobotAsync>d__.<>1__state = -1;
			<ReadCommandFromRobotAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadCommandFromRobotAsync>d__13>(ref <ReadCommandFromRobotAsync>d__);
			return <ReadCommandFromRobotAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc />
		// Token: 0x06000427 RID: 1063 RVA: 0x00010480 File Offset: 0x0000E680
		[DebuggerStepThrough]
		protected override Task<OperateResult> InitializationOnConnectAsync(Socket socket)
		{
			FanucInterfaceNet.<InitializationOnConnectAsync>d__14 <InitializationOnConnectAsync>d__ = new FanucInterfaceNet.<InitializationOnConnectAsync>d__14();
			<InitializationOnConnectAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<InitializationOnConnectAsync>d__.<>4__this = this;
			<InitializationOnConnectAsync>d__.socket = socket;
			<InitializationOnConnectAsync>d__.<>1__state = -1;
			<InitializationOnConnectAsync>d__.<>t__builder.Start<FanucInterfaceNet.<InitializationOnConnectAsync>d__14>(ref <InitializationOnConnectAsync>d__);
			return <InitializationOnConnectAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.Net.IRobotNet.Read(System.String)" />
		// Token: 0x06000428 RID: 1064 RVA: 0x000104CB File Offset: 0x0000E6CB
		[HslMqttApi(ApiTopic = "ReadRobotByte", Description = "Read the robot's original byte data information according to the address")]
		public OperateResult<byte[]> Read(string address)
		{
			return this.Read(8, 1, 6130);
		}

		/// <inheritdoc cref="M:HslCommunication.Core.Net.IRobotNet.ReadString(System.String)" />
		// Token: 0x06000429 RID: 1065 RVA: 0x000104DC File Offset: 0x0000E6DC
		[HslMqttApi(ApiTopic = "ReadRobotString", Description = "Read the string data information of the robot based on the address")]
		public OperateResult<string> ReadString(string address)
		{
			bool flag = string.IsNullOrEmpty(address);
			OperateResult<string> result;
			if (flag)
			{
				OperateResult<FanucData> operateResult = this.ReadFanucData();
				bool flag2 = !operateResult.IsSuccess;
				if (flag2)
				{
					result = OperateResult.CreateFailedResult<string>(operateResult);
				}
				else
				{
					this.fanucDataRetain = operateResult.Content;
					this.fanucDataRefreshTime = DateTime.Now;
					result = OperateResult.CreateSuccessResult<string>(JsonConvert.SerializeObject(operateResult.Content, 1));
				}
			}
			else
			{
				bool flag3 = (DateTime.Now - this.fanucDataRefreshTime).TotalMilliseconds > (double)this.FanucDataRetainTime || this.fanucDataRetain == null;
				if (flag3)
				{
					OperateResult<FanucData> operateResult2 = this.ReadFanucData();
					bool flag4 = !operateResult2.IsSuccess;
					if (flag4)
					{
						return OperateResult.CreateFailedResult<string>(operateResult2);
					}
					this.fanucDataRetain = operateResult2.Content;
					this.fanucDataRefreshTime = DateTime.Now;
				}
				foreach (PropertyInfo propertyInfo in this.fanucDataPropertyInfo)
				{
					bool flag5 = propertyInfo.Name == address;
					if (flag5)
					{
						return OperateResult.CreateSuccessResult<string>(JsonConvert.SerializeObject(propertyInfo.GetValue(this.fanucDataRetain, null), 1));
					}
				}
				result = new OperateResult<string>(StringResources.Language.NotSupportedDataType);
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.Read(System.String)" />
		// Token: 0x0600042A RID: 1066 RVA: 0x00010620 File Offset: 0x0000E820
		[DebuggerStepThrough]
		public Task<OperateResult<byte[]>> ReadAsync(string address)
		{
			FanucInterfaceNet.<ReadAsync>d__17 <ReadAsync>d__ = new FanucInterfaceNet.<ReadAsync>d__17();
			<ReadAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<byte[]>>.Create();
			<ReadAsync>d__.<>4__this = this;
			<ReadAsync>d__.address = address;
			<ReadAsync>d__.<>1__state = -1;
			<ReadAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadAsync>d__17>(ref <ReadAsync>d__);
			return <ReadAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadString(System.String)" />
		// Token: 0x0600042B RID: 1067 RVA: 0x0001066C File Offset: 0x0000E86C
		[DebuggerStepThrough]
		public Task<OperateResult<string>> ReadStringAsync(string address)
		{
			FanucInterfaceNet.<ReadStringAsync>d__18 <ReadStringAsync>d__ = new FanucInterfaceNet.<ReadStringAsync>d__18();
			<ReadStringAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<string>>.Create();
			<ReadStringAsync>d__.<>4__this = this;
			<ReadStringAsync>d__.address = address;
			<ReadStringAsync>d__.<>1__state = -1;
			<ReadStringAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadStringAsync>d__18>(ref <ReadStringAsync>d__);
			return <ReadStringAsync>d__.<>t__builder.Task;
		}

		/// <summary>
		/// 按照字为单位批量读取设备的原始数据，需要指定地址及长度，地址示例：D1，AI1，AQ1，共计3个区的数据，注意地址的起始为1<br />
		/// Read the raw data of the device in batches in units of words. You need to specify the address and length. Example addresses: D1, AI1, AQ1, a total of 3 areas of data. Note that the start of the address is 1.
		/// </summary>
		/// <param name="address">起始地址，地址示例：D1，AI1，AQ1，共计3个区的数据，注意起始的起始为1</param>
		/// <param name="length">读取的长度，字为单位</param>
		/// <returns>返回的数据信息结果</returns>
		// Token: 0x0600042C RID: 1068 RVA: 0x000106B8 File Offset: 0x0000E8B8
		[HslMqttApi("ReadByteArray", "")]
		public override OperateResult<byte[]> Read(string address, ushort length)
		{
			OperateResult<byte, ushort> operateResult = FanucHelper.AnalysisFanucAddress(address);
			bool flag = !operateResult.IsSuccess;
			OperateResult<byte[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<byte[]>(operateResult);
			}
			else
			{
				bool flag2 = operateResult.Content1 == 8 || operateResult.Content1 == 10 || operateResult.Content1 == 12;
				if (flag2)
				{
					result = this.Read(operateResult.Content1, operateResult.Content2, length);
				}
				else
				{
					result = new OperateResult<byte[]>(StringResources.Language.NotSupportedDataType);
				}
			}
			return result;
		}

		/// <summary>
		/// 写入原始的byte数组数据到指定的地址，返回是否写入成功，地址示例：D1，AI1，AQ1，共计3个区的数据，注意起始的起始为1<br />
		/// Write the original byte array data to the specified address, and return whether the write was successful. Example addresses: D1, AI1, AQ1, a total of 3 areas of data. Note that the start of the address is 1.
		/// </summary>
		/// <param name="address">起始地址，地址示例：D1，AI1，AQ1，共计3个区的数据，注意起始的起始为1</param>
		/// <param name="value">写入值</param>
		/// <returns>带有成功标识的结果类对象</returns>
		// Token: 0x0600042D RID: 1069 RVA: 0x00010730 File Offset: 0x0000E930
		[HslMqttApi("WriteByteArray", "")]
		public override OperateResult Write(string address, byte[] value)
		{
			OperateResult<byte, ushort> operateResult = FanucHelper.AnalysisFanucAddress(address);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<byte[]>(operateResult);
			}
			else
			{
				bool flag2 = operateResult.Content1 == 8 || operateResult.Content1 == 10 || operateResult.Content1 == 12;
				if (flag2)
				{
					result = this.Write(operateResult.Content1, operateResult.Content2, value);
				}
				else
				{
					result = new OperateResult<byte[]>(StringResources.Language.NotSupportedDataType);
				}
			}
			return result;
		}

		/// <summary>
		/// 按照位为单位批量读取设备的原始数据，需要指定地址及长度，地址示例：M1，I1，Q1，共计3个区的数据，注意地址的起始为1<br />
		/// Read the raw data of the device in batches in units of boolean. You need to specify the address and length. Example addresses: M1，I1，Q1, a total of 3 areas of data. Note that the start of the address is 1.
		/// </summary>
		/// <param name="address">起始地址，地址示例：M1，I1，Q1，共计3个区的数据，注意地址的起始为1</param>
		/// <param name="length">读取的长度，位为单位</param>
		/// <returns>返回的数据信息结果</returns>
		// Token: 0x0600042E RID: 1070 RVA: 0x000107A8 File Offset: 0x0000E9A8
		[HslMqttApi("ReadBoolArray", "")]
		public override OperateResult<bool[]> ReadBool(string address, ushort length)
		{
			OperateResult<byte, ushort> operateResult = FanucHelper.AnalysisFanucAddress(address);
			bool flag = !operateResult.IsSuccess;
			OperateResult<bool[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<bool[]>(operateResult);
			}
			else
			{
				bool flag2 = operateResult.Content1 == 70 || operateResult.Content1 == 72 || operateResult.Content1 == 76;
				if (flag2)
				{
					result = this.ReadBool(operateResult.Content1, operateResult.Content2, length);
				}
				else
				{
					result = new OperateResult<bool[]>(StringResources.Language.NotSupportedDataType);
				}
			}
			return result;
		}

		/// <summary>
		/// 批量写入<see cref="T:System.Boolean" />数组数据，返回是否写入成功，需要指定起始地址，地址示例：M1，I1，Q1，共计3个区的数据，注意地址的起始为1<br />
		/// Write <see cref="T:System.Boolean" /> array data in batches. If the write success is returned, you need to specify the starting address. Example address: M1, I1, Q1, a total of 3 areas of data. Note that the starting address is 1.
		/// </summary>
		/// <param name="address">起始地址，地址示例：M1，I1，Q1，共计3个区的数据，注意地址的起始为1</param>
		/// <param name="value">等待写入的数据值</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x0600042F RID: 1071 RVA: 0x00010824 File Offset: 0x0000EA24
		[HslMqttApi("WriteBoolArray", "")]
		public override OperateResult Write(string address, bool[] value)
		{
			OperateResult<byte, ushort> operateResult = FanucHelper.AnalysisFanucAddress(address);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				bool flag2 = operateResult.Content1 == 70 || operateResult.Content1 == 72 || operateResult.Content1 == 76;
				if (flag2)
				{
					result = this.WriteBool(operateResult.Content1, operateResult.Content2, value);
				}
				else
				{
					result = new OperateResult(StringResources.Language.NotSupportedDataType);
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.Read(System.String,System.UInt16)" />
		// Token: 0x06000430 RID: 1072 RVA: 0x00010898 File Offset: 0x0000EA98
		[DebuggerStepThrough]
		public override Task<OperateResult<byte[]>> ReadAsync(string address, ushort length)
		{
			FanucInterfaceNet.<ReadAsync>d__23 <ReadAsync>d__ = new FanucInterfaceNet.<ReadAsync>d__23();
			<ReadAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<byte[]>>.Create();
			<ReadAsync>d__.<>4__this = this;
			<ReadAsync>d__.address = address;
			<ReadAsync>d__.length = length;
			<ReadAsync>d__.<>1__state = -1;
			<ReadAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadAsync>d__23>(ref <ReadAsync>d__);
			return <ReadAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.Write(System.String,System.Byte[])" />
		// Token: 0x06000431 RID: 1073 RVA: 0x000108EC File Offset: 0x0000EAEC
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, byte[] value)
		{
			FanucInterfaceNet.<WriteAsync>d__24 <WriteAsync>d__ = new FanucInterfaceNet.<WriteAsync>d__24();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.value = value;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteAsync>d__24>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadBool(System.String,System.UInt16)" />
		// Token: 0x06000432 RID: 1074 RVA: 0x00010940 File Offset: 0x0000EB40
		[DebuggerStepThrough]
		public override Task<OperateResult<bool[]>> ReadBoolAsync(string address, ushort length)
		{
			FanucInterfaceNet.<ReadBoolAsync>d__25 <ReadBoolAsync>d__ = new FanucInterfaceNet.<ReadBoolAsync>d__25();
			<ReadBoolAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadBoolAsync>d__.<>4__this = this;
			<ReadBoolAsync>d__.address = address;
			<ReadBoolAsync>d__.length = length;
			<ReadBoolAsync>d__.<>1__state = -1;
			<ReadBoolAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadBoolAsync>d__25>(ref <ReadBoolAsync>d__);
			return <ReadBoolAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.Write(System.String,System.Boolean[])" />
		// Token: 0x06000433 RID: 1075 RVA: 0x00010994 File Offset: 0x0000EB94
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, bool[] value)
		{
			FanucInterfaceNet.<WriteAsync>d__26 <WriteAsync>d__ = new FanucInterfaceNet.<WriteAsync>d__26();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.value = value;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteAsync>d__26>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <summary>
		/// 按照字为单位批量读取设备的原始数据，需要指定数据块地址，偏移地址及长度，主要针对08, 10, 12的数据块，注意地址的起始为1<br />
		/// Read the raw data of the device in batches in units of words. You need to specify the data block address, offset address, and length. It is mainly for data blocks of 08, 10, and 12. Note that the start of the address is 1.
		/// </summary>
		/// <param name="select">数据块信息</param>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取的长度，字为单位</param>
		// Token: 0x06000434 RID: 1076 RVA: 0x000109E8 File Offset: 0x0000EBE8
		public OperateResult<byte[]> Read(byte select, ushort address, ushort length)
		{
			byte[] send = FanucHelper.BulidReadData(select, address, length);
			OperateResult<byte[]> operateResult = base.ReadFromCoreServer(send);
			bool flag = !operateResult.IsSuccess;
			OperateResult<byte[]> result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				bool flag2 = operateResult.Content[31] == 148;
				if (flag2)
				{
					result = OperateResult.CreateSuccessResult<byte[]>(SoftBasic.ArrayRemoveBegin<byte>(operateResult.Content, 56));
				}
				else
				{
					bool flag3 = operateResult.Content[31] == 212;
					if (flag3)
					{
						result = OperateResult.CreateSuccessResult<byte[]>(SoftBasic.ArraySelectMiddle<byte>(operateResult.Content, 44, (int)(length * 2)));
					}
					else
					{
						result = new OperateResult<byte[]>((int)operateResult.Content[31], "Error");
					}
				}
			}
			return result;
		}

		/// <summary>
		/// 写入原始的byte数组数据到指定的地址，返回是否写入成功，，需要指定数据块地址，偏移地址，主要针对08, 10, 12的数据块，注意起始的起始为1<br />
		/// Write the original byte array data to the specified address, and return whether the writing is successful. You need to specify the data block address and offset address, 
		/// which are mainly for the data blocks of 08, 10, and 12. Note that the start of the start is 1.
		/// </summary>
		/// <param name="select">数据块信息</param>
		/// <param name="address">偏移地址</param>
		/// <param name="value">原始数据内容</param>
		// Token: 0x06000435 RID: 1077 RVA: 0x00010A88 File Offset: 0x0000EC88
		public OperateResult Write(byte select, ushort address, byte[] value)
		{
			byte[] send = FanucHelper.BuildWriteData(select, address, value, value.Length / 2);
			OperateResult<byte[]> operateResult = base.ReadFromCoreServer(send);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				bool flag2 = operateResult.Content[31] == 212;
				if (flag2)
				{
					result = OperateResult.CreateSuccessResult();
				}
				else
				{
					result = new OperateResult<byte[]>((int)operateResult.Content[31], "Error");
				}
			}
			return result;
		}

		/// <summary>
		/// 按照位为单位批量读取设备的原始数据，需要指定数据块地址，偏移地址及长度，主要针对70, 72, 76的数据块，注意地址的起始为1<br />
		/// </summary>
		/// <param name="select">数据块信息</param>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取的长度，字为单位</param>
		// Token: 0x06000436 RID: 1078 RVA: 0x00010AF4 File Offset: 0x0000ECF4
		public OperateResult<bool[]> ReadBool(byte select, ushort address, ushort length)
		{
			int num = (int)(address - 1 - (address - 1) % 8 + 1);
			int num2 = (int)(((address + length - 1) % 8 == 0) ? (address + length - 1) : ((address + length - 1) / 8 * 8 + 8));
			int num3 = (num2 - num + 1) / 8;
			byte[] array = FanucHelper.BulidReadData(select, address, (ushort)(num3 * 8));
			ILogNet logNet = base.LogNet;
			if (logNet != null)
			{
				logNet.WriteDebug(this.ToString(), StringResources.Language.Send + SoftBasic.ByteToHexString(array));
			}
			OperateResult<byte[]> operateResult = base.ReadFromCoreServer(array);
			bool flag = !operateResult.IsSuccess;
			OperateResult<bool[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<bool[]>(operateResult);
			}
			else
			{
				ILogNet logNet2 = base.LogNet;
				if (logNet2 != null)
				{
					logNet2.WriteDebug(this.ToString(), StringResources.Language.Receive + SoftBasic.ByteToHexString(operateResult.Content));
				}
				bool flag2 = operateResult.Content[31] == 148;
				if (flag2)
				{
					bool[] sourceArray = SoftBasic.ByteToBoolArray(SoftBasic.ArrayRemoveBegin<byte>(operateResult.Content, 56));
					bool[] array2 = new bool[(int)length];
					Array.Copy(sourceArray, (int)address - num, array2, 0, (int)length);
					result = OperateResult.CreateSuccessResult<bool[]>(array2);
				}
				else
				{
					bool flag3 = operateResult.Content[31] == 212;
					if (flag3)
					{
						bool[] sourceArray2 = SoftBasic.ByteToBoolArray(SoftBasic.ArraySelectMiddle<byte>(operateResult.Content, 44, num3));
						bool[] array3 = new bool[(int)length];
						Array.Copy(sourceArray2, (int)address - num, array3, 0, (int)length);
						result = OperateResult.CreateSuccessResult<bool[]>(array3);
					}
					else
					{
						result = new OperateResult<bool[]>((int)operateResult.Content[31], "Error");
					}
				}
			}
			return result;
		}

		/// <summary>
		/// 批量写入<see cref="T:System.Boolean" />数组数据，返回是否写入成功，需要指定数据块地址，偏移地址，主要针对70, 72, 76的数据块，注意起始的起始为1
		/// </summary>
		/// <param name="select">数据块信息</param>
		/// <param name="address">偏移地址</param>
		/// <param name="value">原始的数据内容</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x06000437 RID: 1079 RVA: 0x00010C80 File Offset: 0x0000EE80
		public OperateResult WriteBool(byte select, ushort address, bool[] value)
		{
			int num = (int)(address - 1 - (address - 1) % 8 + 1);
			int num2 = (((int)address + value.Length - 1) % 8 == 0) ? ((int)address + value.Length - 1) : (((int)address + value.Length - 1) / 8 * 8 + 8);
			int num3 = (num2 - num + 1) / 8;
			bool[] array = new bool[num3 * 8];
			Array.Copy(value, 0, array, (int)address - num, value.Length);
			byte[] send = FanucHelper.BuildWriteData(select, address, base.ByteTransform.TransByte(array), value.Length);
			OperateResult<byte[]> operateResult = base.ReadFromCoreServer(send);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<short[]>(operateResult);
			}
			else
			{
				bool flag2 = operateResult.Content[31] == 212;
				if (flag2)
				{
					result = OperateResult.CreateSuccessResult();
				}
				else
				{
					result = new OperateResult();
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.Read(System.Byte,System.UInt16,System.UInt16)" />
		// Token: 0x06000438 RID: 1080 RVA: 0x00010D44 File Offset: 0x0000EF44
		[DebuggerStepThrough]
		public Task<OperateResult<byte[]>> ReadAsync(byte select, ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadAsync>d__31 <ReadAsync>d__ = new FanucInterfaceNet.<ReadAsync>d__31();
			<ReadAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<byte[]>>.Create();
			<ReadAsync>d__.<>4__this = this;
			<ReadAsync>d__.select = select;
			<ReadAsync>d__.address = address;
			<ReadAsync>d__.length = length;
			<ReadAsync>d__.<>1__state = -1;
			<ReadAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadAsync>d__31>(ref <ReadAsync>d__);
			return <ReadAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.Write(System.Byte,System.UInt16,System.Byte[])" />
		// Token: 0x06000439 RID: 1081 RVA: 0x00010DA0 File Offset: 0x0000EFA0
		[DebuggerStepThrough]
		public Task<OperateResult> WriteAsync(byte select, ushort address, byte[] value)
		{
			FanucInterfaceNet.<WriteAsync>d__32 <WriteAsync>d__ = new FanucInterfaceNet.<WriteAsync>d__32();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.select = select;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.value = value;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteAsync>d__32>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadBool(System.Byte,System.UInt16,System.UInt16)" />
		// Token: 0x0600043A RID: 1082 RVA: 0x00010DFC File Offset: 0x0000EFFC
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadBoolAsync(byte select, ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadBoolAsync>d__33 <ReadBoolAsync>d__ = new FanucInterfaceNet.<ReadBoolAsync>d__33();
			<ReadBoolAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadBoolAsync>d__.<>4__this = this;
			<ReadBoolAsync>d__.select = select;
			<ReadBoolAsync>d__.address = address;
			<ReadBoolAsync>d__.length = length;
			<ReadBoolAsync>d__.<>1__state = -1;
			<ReadBoolAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadBoolAsync>d__33>(ref <ReadBoolAsync>d__);
			return <ReadBoolAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WriteBool(System.Byte,System.UInt16,System.Boolean[])" />
		// Token: 0x0600043B RID: 1083 RVA: 0x00010E58 File Offset: 0x0000F058
		[DebuggerStepThrough]
		public Task<OperateResult> WriteBoolAsync(byte select, ushort address, bool[] value)
		{
			FanucInterfaceNet.<WriteBoolAsync>d__34 <WriteBoolAsync>d__ = new FanucInterfaceNet.<WriteBoolAsync>d__34();
			<WriteBoolAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteBoolAsync>d__.<>4__this = this;
			<WriteBoolAsync>d__.select = select;
			<WriteBoolAsync>d__.address = address;
			<WriteBoolAsync>d__.value = value;
			<WriteBoolAsync>d__.<>1__state = -1;
			<WriteBoolAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteBoolAsync>d__34>(ref <WriteBoolAsync>d__);
			return <WriteBoolAsync>d__.<>t__builder.Task;
		}

		/// <summary>
		/// 读取机器人的详细信息，返回解析后的数据类型<br />
		/// Read the details of the robot and return the resolved data type
		/// </summary>
		/// <returns>结果数据信息</returns>
		// Token: 0x0600043C RID: 1084 RVA: 0x00010EB4 File Offset: 0x0000F0B4
		[HslMqttApi(Description = "Read the details of the robot and return the resolved data type")]
		public OperateResult<FanucData> ReadFanucData()
		{
			OperateResult<byte[]> operateResult = this.Read("");
			bool flag = !operateResult.IsSuccess;
			OperateResult<FanucData> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<FanucData>(operateResult);
			}
			else
			{
				result = FanucData.PraseFrom(operateResult.Content);
			}
			return result;
		}

		/// <summary>
		/// 读取机器人的SDO信息<br />
		/// Read the SDO information of the robot
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取的长度</param>
		/// <returns>结果数据</returns>
		// Token: 0x0600043D RID: 1085 RVA: 0x00010EF4 File Offset: 0x0000F0F4
		[HslMqttApi(Description = "Read the SDO information of the robot")]
		public OperateResult<bool[]> ReadSDO(ushort address, ushort length)
		{
			bool flag = address < 11001;
			OperateResult<bool[]> result;
			if (flag)
			{
				result = this.ReadBool(70, address, length);
			}
			else
			{
				result = this.ReadPMCR2(address - 11000, length);
			}
			return result;
		}

		/// <summary>
		/// 写入机器人的SDO信息<br />
		/// Write the SDO information of the robot
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="value">数据值</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x0600043E RID: 1086 RVA: 0x00010F30 File Offset: 0x0000F130
		[HslMqttApi(Description = "Write the SDO information of the robot")]
		public OperateResult WriteSDO(ushort address, bool[] value)
		{
			bool flag = address < 11001;
			OperateResult result;
			if (flag)
			{
				result = this.WriteBool(70, address, value);
			}
			else
			{
				result = this.WritePMCR2(address - 11000, value);
			}
			return result;
		}

		/// <summary>
		/// 读取机器人的SDI信息<br />
		/// Read the SDI information of the robot
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取长度</param>
		/// <returns>结果内容</returns>
		// Token: 0x0600043F RID: 1087 RVA: 0x00010F6A File Offset: 0x0000F16A
		[HslMqttApi(Description = "Read the SDI information of the robot")]
		public OperateResult<bool[]> ReadSDI(ushort address, ushort length)
		{
			return this.ReadBool(72, address, length);
		}

		/// <summary>
		/// 写入机器人的SDI信息<br />
		/// Write the SDI information of the robot
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="value">数据值</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x06000440 RID: 1088 RVA: 0x00010F76 File Offset: 0x0000F176
		[HslMqttApi(Description = "Write the SDI information of the robot")]
		public OperateResult WriteSDI(ushort address, bool[] value)
		{
			return this.WriteBool(72, address, value);
		}

		/// <summary>
		/// 读取机器人的RDI信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取长度</param>
		/// <returns>结果信息</returns>
		// Token: 0x06000441 RID: 1089 RVA: 0x00010F82 File Offset: 0x0000F182
		[HslMqttApi]
		public OperateResult<bool[]> ReadRDI(ushort address, ushort length)
		{
			return this.ReadBool(72, address + 5000, length);
		}

		/// <summary>
		/// 写入机器人的RDI信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="value">数据值</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x06000442 RID: 1090 RVA: 0x00010F95 File Offset: 0x0000F195
		[HslMqttApi]
		public OperateResult WriteRDI(ushort address, bool[] value)
		{
			return this.WriteBool(72, address + 5000, value);
		}

		/// <summary>
		/// 读取机器人的UI信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取长度</param>
		/// <returns>结果信息</returns>
		// Token: 0x06000443 RID: 1091 RVA: 0x00010FA8 File Offset: 0x0000F1A8
		[HslMqttApi]
		public OperateResult<bool[]> ReadUI(ushort address, ushort length)
		{
			return this.ReadBool(72, address + 6000, length);
		}

		/// <summary>
		/// 读取机器人的UO信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取长度</param>
		/// <returns>结果信息</returns>
		// Token: 0x06000444 RID: 1092 RVA: 0x00010FBB File Offset: 0x0000F1BB
		[HslMqttApi]
		public OperateResult<bool[]> ReadUO(ushort address, ushort length)
		{
			return this.ReadBool(70, address + 6000, length);
		}

		/// <summary>
		/// 写入机器人的UO信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="value">数据值</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x06000445 RID: 1093 RVA: 0x00010FCE File Offset: 0x0000F1CE
		[HslMqttApi]
		public OperateResult WriteUO(ushort address, bool[] value)
		{
			return this.WriteBool(70, address + 6000, value);
		}

		/// <summary>
		/// 读取机器人的SI信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取长度</param>
		/// <returns>结果信息</returns>
		// Token: 0x06000446 RID: 1094 RVA: 0x00010FE1 File Offset: 0x0000F1E1
		[HslMqttApi]
		public OperateResult<bool[]> ReadSI(ushort address, ushort length)
		{
			return this.ReadBool(72, address + 7000, length);
		}

		/// <summary>
		/// 读取机器人的SO信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取长度</param>
		/// <returns>结果信息</returns>
		// Token: 0x06000447 RID: 1095 RVA: 0x00010FF4 File Offset: 0x0000F1F4
		[HslMqttApi]
		public OperateResult<bool[]> ReadSO(ushort address, ushort length)
		{
			return this.ReadBool(70, address + 7000, length);
		}

		/// <summary>
		/// 写入机器人的SO信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="value">数据值</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x06000448 RID: 1096 RVA: 0x00011007 File Offset: 0x0000F207
		[HslMqttApi]
		public OperateResult WriteSO(ushort address, bool[] value)
		{
			return this.WriteBool(70, address + 7000, value);
		}

		/// <summary>
		/// 读取机器人的GI信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="length">数据长度</param>
		/// <returns>结果信息</returns>
		// Token: 0x06000449 RID: 1097 RVA: 0x0001101C File Offset: 0x0000F21C
		[HslMqttApi]
		public OperateResult<ushort[]> ReadGI(ushort address, ushort length)
		{
			return ByteTransformHelper.GetSuccessResultFromOther<ushort[], byte[]>(this.Read(12, address, length), (byte[] m) => this.ByteTransform.TransUInt16(m, 0, (int)length));
		}

		/// <summary>
		/// 写入机器人的GI信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="value">数据值</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x0600044A RID: 1098 RVA: 0x0001105D File Offset: 0x0000F25D
		[HslMqttApi]
		public OperateResult WriteGI(ushort address, ushort[] value)
		{
			return this.Write(12, address, base.ByteTransform.TransByte(value));
		}

		/// <summary>
		/// 读取机器人的GO信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取长度</param>
		/// <returns>结果信息</returns>
		// Token: 0x0600044B RID: 1099 RVA: 0x00011074 File Offset: 0x0000F274
		[HslMqttApi]
		public OperateResult<ushort[]> ReadGO(ushort address, ushort length)
		{
			bool flag = address >= 10001;
			if (flag)
			{
				address -= 6000;
			}
			return ByteTransformHelper.GetSuccessResultFromOther<ushort[], byte[]>(this.Read(10, address, length), (byte[] m) => this.ByteTransform.TransUInt16(m, 0, (int)length));
		}

		/// <summary>
		/// 写入机器人的GO信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="value">数据值</param>
		/// <returns>写入结果</returns>
		// Token: 0x0600044C RID: 1100 RVA: 0x000110D4 File Offset: 0x0000F2D4
		[HslMqttApi]
		public OperateResult WriteGO(ushort address, ushort[] value)
		{
			bool flag = address >= 10001;
			if (flag)
			{
				address -= 6000;
			}
			return this.Write(10, address, base.ByteTransform.TransByte(value));
		}

		/// <summary>
		/// 读取机器人的PMCR2信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取长度</param>
		/// <returns>结果信息</returns>
		// Token: 0x0600044D RID: 1101 RVA: 0x00011114 File Offset: 0x0000F314
		[HslMqttApi]
		public OperateResult<bool[]> ReadPMCR2(ushort address, ushort length)
		{
			return this.ReadBool(76, address, length);
		}

		/// <summary>
		/// 写入机器人的PMCR2信息
		/// </summary>
		/// <param name="address">偏移信息</param>
		/// <param name="value">数据值</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x0600044E RID: 1102 RVA: 0x00011120 File Offset: 0x0000F320
		[HslMqttApi]
		public OperateResult WritePMCR2(ushort address, bool[] value)
		{
			return this.WriteBool(76, address, value);
		}

		/// <summary>
		/// 读取机器人的RDO信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="length">读取长度</param>
		/// <returns>结果信息</returns>
		// Token: 0x0600044F RID: 1103 RVA: 0x0001112C File Offset: 0x0000F32C
		[HslMqttApi]
		public OperateResult<bool[]> ReadRDO(ushort address, ushort length)
		{
			return this.ReadBool(70, address + 5000, length);
		}

		/// <summary>
		/// 写入机器人的RDO信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="value">数据值</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x06000450 RID: 1104 RVA: 0x0001113F File Offset: 0x0000F33F
		[HslMqttApi]
		public OperateResult WriteRDO(ushort address, bool[] value)
		{
			return this.WriteBool(70, address + 5000, value);
		}

		/// <summary>
		/// 写入机器人的Rxyzwpr信息，谨慎调用，
		/// </summary>
		/// <param name="Address">偏移地址</param>
		/// <param name="Xyzwpr">姿态信息</param>
		/// <param name="Config">设置信息</param>
		/// <param name="UserFrame">参考系</param>
		/// <param name="UserTool">工具</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x06000451 RID: 1105 RVA: 0x00011154 File Offset: 0x0000F354
		[HslMqttApi]
		public OperateResult WriteRXyzwpr(ushort Address, float[] Xyzwpr, short[] Config, short UserFrame, short UserTool)
		{
			int num = Xyzwpr.Length * 4 + Config.Length * 2 + 2;
			byte[] array = new byte[num];
			base.ByteTransform.TransByte(Xyzwpr).CopyTo(array, 0);
			base.ByteTransform.TransByte(Config).CopyTo(array, 36);
			OperateResult operateResult = this.Write(8, Address, array);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				bool flag2 = 0 <= UserFrame && UserFrame <= 15;
				if (flag2)
				{
					bool flag3 = 0 <= UserTool && UserTool <= 15;
					if (flag3)
					{
						operateResult = this.Write(8, Address + 45, base.ByteTransform.TransByte(new short[]
						{
							UserFrame,
							UserTool
						}));
						bool flag4 = !operateResult.IsSuccess;
						if (flag4)
						{
							return operateResult;
						}
					}
					else
					{
						operateResult = this.Write(8, Address + 45, base.ByteTransform.TransByte(new short[]
						{
							UserFrame
						}));
						bool flag5 = !operateResult.IsSuccess;
						if (flag5)
						{
							return operateResult;
						}
					}
				}
				else
				{
					bool flag6 = 0 <= UserTool && UserTool <= 15;
					if (flag6)
					{
						operateResult = this.Write(8, Address + 46, base.ByteTransform.TransByte(new short[]
						{
							UserTool
						}));
						bool flag7 = !operateResult.IsSuccess;
						if (flag7)
						{
							return operateResult;
						}
					}
				}
				result = OperateResult.CreateSuccessResult();
			}
			return result;
		}

		/// <summary>
		/// 写入机器人的Joint信息
		/// </summary>
		/// <param name="address">偏移地址</param>
		/// <param name="joint">关节坐标</param>
		/// <param name="UserFrame">参考系</param>
		/// <param name="UserTool">工具</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x06000452 RID: 1106 RVA: 0x000112CC File Offset: 0x0000F4CC
		[HslMqttApi]
		public OperateResult WriteRJoint(ushort address, float[] joint, short UserFrame, short UserTool)
		{
			OperateResult operateResult = this.Write(8, address + 26, base.ByteTransform.TransByte(joint));
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				bool flag2 = 0 <= UserFrame && UserFrame <= 15;
				if (flag2)
				{
					bool flag3 = 0 <= UserTool && UserTool <= 15;
					if (flag3)
					{
						operateResult = this.Write(8, address + 44, base.ByteTransform.TransByte(new short[]
						{
							0,
							UserFrame,
							UserTool
						}));
						bool flag4 = !operateResult.IsSuccess;
						if (flag4)
						{
							return operateResult;
						}
					}
					else
					{
						operateResult = this.Write(8, address + 44, base.ByteTransform.TransByte(new short[]
						{
							0,
							UserFrame
						}));
						bool flag5 = !operateResult.IsSuccess;
						if (flag5)
						{
							return operateResult;
						}
					}
				}
				else
				{
					operateResult = this.Write(8, address + 44, base.ByteTransform.TransByte(new short[1]));
					bool flag6 = !operateResult.IsSuccess;
					if (flag6)
					{
						return operateResult;
					}
					bool flag7 = 0 <= UserTool && UserTool <= 15;
					if (flag7)
					{
						operateResult = this.Write(8, address + 44, base.ByteTransform.TransByte(new short[]
						{
							0,
							UserTool
						}));
						bool flag8 = !operateResult.IsSuccess;
						if (flag8)
						{
							return operateResult;
						}
					}
				}
				result = OperateResult.CreateSuccessResult();
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadFanucData" />
		// Token: 0x06000453 RID: 1107 RVA: 0x00011444 File Offset: 0x0000F644
		[DebuggerStepThrough]
		public Task<OperateResult<FanucData>> ReadFanucDataAsync()
		{
			FanucInterfaceNet.<ReadFanucDataAsync>d__58 <ReadFanucDataAsync>d__ = new FanucInterfaceNet.<ReadFanucDataAsync>d__58();
			<ReadFanucDataAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<FanucData>>.Create();
			<ReadFanucDataAsync>d__.<>4__this = this;
			<ReadFanucDataAsync>d__.<>1__state = -1;
			<ReadFanucDataAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadFanucDataAsync>d__58>(ref <ReadFanucDataAsync>d__);
			return <ReadFanucDataAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadSDO(System.UInt16,System.UInt16)" />
		// Token: 0x06000454 RID: 1108 RVA: 0x00011488 File Offset: 0x0000F688
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadSDOAsync(ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadSDOAsync>d__59 <ReadSDOAsync>d__ = new FanucInterfaceNet.<ReadSDOAsync>d__59();
			<ReadSDOAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadSDOAsync>d__.<>4__this = this;
			<ReadSDOAsync>d__.address = address;
			<ReadSDOAsync>d__.length = length;
			<ReadSDOAsync>d__.<>1__state = -1;
			<ReadSDOAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadSDOAsync>d__59>(ref <ReadSDOAsync>d__);
			return <ReadSDOAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WriteSDO(System.UInt16,System.Boolean[])" />
		// Token: 0x06000455 RID: 1109 RVA: 0x000114DC File Offset: 0x0000F6DC
		[DebuggerStepThrough]
		public Task<OperateResult> WriteSDOAsync(ushort address, bool[] value)
		{
			FanucInterfaceNet.<WriteSDOAsync>d__60 <WriteSDOAsync>d__ = new FanucInterfaceNet.<WriteSDOAsync>d__60();
			<WriteSDOAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteSDOAsync>d__.<>4__this = this;
			<WriteSDOAsync>d__.address = address;
			<WriteSDOAsync>d__.value = value;
			<WriteSDOAsync>d__.<>1__state = -1;
			<WriteSDOAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteSDOAsync>d__60>(ref <WriteSDOAsync>d__);
			return <WriteSDOAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadSDI(System.UInt16,System.UInt16)" />
		// Token: 0x06000456 RID: 1110 RVA: 0x00011530 File Offset: 0x0000F730
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadSDIAsync(ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadSDIAsync>d__61 <ReadSDIAsync>d__ = new FanucInterfaceNet.<ReadSDIAsync>d__61();
			<ReadSDIAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadSDIAsync>d__.<>4__this = this;
			<ReadSDIAsync>d__.address = address;
			<ReadSDIAsync>d__.length = length;
			<ReadSDIAsync>d__.<>1__state = -1;
			<ReadSDIAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadSDIAsync>d__61>(ref <ReadSDIAsync>d__);
			return <ReadSDIAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WriteSDI(System.UInt16,System.Boolean[])" />
		// Token: 0x06000457 RID: 1111 RVA: 0x00011584 File Offset: 0x0000F784
		[DebuggerStepThrough]
		public Task<OperateResult> WriteSDIAsync(ushort address, bool[] value)
		{
			FanucInterfaceNet.<WriteSDIAsync>d__62 <WriteSDIAsync>d__ = new FanucInterfaceNet.<WriteSDIAsync>d__62();
			<WriteSDIAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteSDIAsync>d__.<>4__this = this;
			<WriteSDIAsync>d__.address = address;
			<WriteSDIAsync>d__.value = value;
			<WriteSDIAsync>d__.<>1__state = -1;
			<WriteSDIAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteSDIAsync>d__62>(ref <WriteSDIAsync>d__);
			return <WriteSDIAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadRDI(System.UInt16,System.UInt16)" />
		// Token: 0x06000458 RID: 1112 RVA: 0x000115D8 File Offset: 0x0000F7D8
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadRDIAsync(ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadRDIAsync>d__63 <ReadRDIAsync>d__ = new FanucInterfaceNet.<ReadRDIAsync>d__63();
			<ReadRDIAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadRDIAsync>d__.<>4__this = this;
			<ReadRDIAsync>d__.address = address;
			<ReadRDIAsync>d__.length = length;
			<ReadRDIAsync>d__.<>1__state = -1;
			<ReadRDIAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadRDIAsync>d__63>(ref <ReadRDIAsync>d__);
			return <ReadRDIAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WriteRDI(System.UInt16,System.Boolean[])" />
		// Token: 0x06000459 RID: 1113 RVA: 0x0001162C File Offset: 0x0000F82C
		[DebuggerStepThrough]
		public Task<OperateResult> WriteRDIAsync(ushort address, bool[] value)
		{
			FanucInterfaceNet.<WriteRDIAsync>d__64 <WriteRDIAsync>d__ = new FanucInterfaceNet.<WriteRDIAsync>d__64();
			<WriteRDIAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteRDIAsync>d__.<>4__this = this;
			<WriteRDIAsync>d__.address = address;
			<WriteRDIAsync>d__.value = value;
			<WriteRDIAsync>d__.<>1__state = -1;
			<WriteRDIAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteRDIAsync>d__64>(ref <WriteRDIAsync>d__);
			return <WriteRDIAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadUI(System.UInt16,System.UInt16)" />
		// Token: 0x0600045A RID: 1114 RVA: 0x00011680 File Offset: 0x0000F880
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadUIAsync(ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadUIAsync>d__65 <ReadUIAsync>d__ = new FanucInterfaceNet.<ReadUIAsync>d__65();
			<ReadUIAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadUIAsync>d__.<>4__this = this;
			<ReadUIAsync>d__.address = address;
			<ReadUIAsync>d__.length = length;
			<ReadUIAsync>d__.<>1__state = -1;
			<ReadUIAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadUIAsync>d__65>(ref <ReadUIAsync>d__);
			return <ReadUIAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadUO(System.UInt16,System.UInt16)" />
		// Token: 0x0600045B RID: 1115 RVA: 0x000116D4 File Offset: 0x0000F8D4
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadUOAsync(ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadUOAsync>d__66 <ReadUOAsync>d__ = new FanucInterfaceNet.<ReadUOAsync>d__66();
			<ReadUOAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadUOAsync>d__.<>4__this = this;
			<ReadUOAsync>d__.address = address;
			<ReadUOAsync>d__.length = length;
			<ReadUOAsync>d__.<>1__state = -1;
			<ReadUOAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadUOAsync>d__66>(ref <ReadUOAsync>d__);
			return <ReadUOAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WriteUO(System.UInt16,System.Boolean[])" />
		// Token: 0x0600045C RID: 1116 RVA: 0x00011728 File Offset: 0x0000F928
		[DebuggerStepThrough]
		public Task<OperateResult> WriteUOAsync(ushort address, bool[] value)
		{
			FanucInterfaceNet.<WriteUOAsync>d__67 <WriteUOAsync>d__ = new FanucInterfaceNet.<WriteUOAsync>d__67();
			<WriteUOAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteUOAsync>d__.<>4__this = this;
			<WriteUOAsync>d__.address = address;
			<WriteUOAsync>d__.value = value;
			<WriteUOAsync>d__.<>1__state = -1;
			<WriteUOAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteUOAsync>d__67>(ref <WriteUOAsync>d__);
			return <WriteUOAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadSI(System.UInt16,System.UInt16)" />
		// Token: 0x0600045D RID: 1117 RVA: 0x0001177C File Offset: 0x0000F97C
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadSIAsync(ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadSIAsync>d__68 <ReadSIAsync>d__ = new FanucInterfaceNet.<ReadSIAsync>d__68();
			<ReadSIAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadSIAsync>d__.<>4__this = this;
			<ReadSIAsync>d__.address = address;
			<ReadSIAsync>d__.length = length;
			<ReadSIAsync>d__.<>1__state = -1;
			<ReadSIAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadSIAsync>d__68>(ref <ReadSIAsync>d__);
			return <ReadSIAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadSO(System.UInt16,System.UInt16)" />
		// Token: 0x0600045E RID: 1118 RVA: 0x000117D0 File Offset: 0x0000F9D0
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadSOAsync(ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadSOAsync>d__69 <ReadSOAsync>d__ = new FanucInterfaceNet.<ReadSOAsync>d__69();
			<ReadSOAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadSOAsync>d__.<>4__this = this;
			<ReadSOAsync>d__.address = address;
			<ReadSOAsync>d__.length = length;
			<ReadSOAsync>d__.<>1__state = -1;
			<ReadSOAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadSOAsync>d__69>(ref <ReadSOAsync>d__);
			return <ReadSOAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WriteSO(System.UInt16,System.Boolean[])" />
		// Token: 0x0600045F RID: 1119 RVA: 0x00011824 File Offset: 0x0000FA24
		[DebuggerStepThrough]
		public Task<OperateResult> WriteSOAsync(ushort address, bool[] value)
		{
			FanucInterfaceNet.<WriteSOAsync>d__70 <WriteSOAsync>d__ = new FanucInterfaceNet.<WriteSOAsync>d__70();
			<WriteSOAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteSOAsync>d__.<>4__this = this;
			<WriteSOAsync>d__.address = address;
			<WriteSOAsync>d__.value = value;
			<WriteSOAsync>d__.<>1__state = -1;
			<WriteSOAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteSOAsync>d__70>(ref <WriteSOAsync>d__);
			return <WriteSOAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadGI(System.UInt16,System.UInt16)" />
		// Token: 0x06000460 RID: 1120 RVA: 0x00011878 File Offset: 0x0000FA78
		[DebuggerStepThrough]
		public Task<OperateResult<ushort[]>> ReadGIAsync(ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadGIAsync>d__71 <ReadGIAsync>d__ = new FanucInterfaceNet.<ReadGIAsync>d__71();
			<ReadGIAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<ushort[]>>.Create();
			<ReadGIAsync>d__.<>4__this = this;
			<ReadGIAsync>d__.address = address;
			<ReadGIAsync>d__.length = length;
			<ReadGIAsync>d__.<>1__state = -1;
			<ReadGIAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadGIAsync>d__71>(ref <ReadGIAsync>d__);
			return <ReadGIAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WriteGI(System.UInt16,System.UInt16[])" />
		// Token: 0x06000461 RID: 1121 RVA: 0x000118CC File Offset: 0x0000FACC
		[DebuggerStepThrough]
		public Task<OperateResult> WriteGIAsync(ushort address, ushort[] value)
		{
			FanucInterfaceNet.<WriteGIAsync>d__72 <WriteGIAsync>d__ = new FanucInterfaceNet.<WriteGIAsync>d__72();
			<WriteGIAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteGIAsync>d__.<>4__this = this;
			<WriteGIAsync>d__.address = address;
			<WriteGIAsync>d__.value = value;
			<WriteGIAsync>d__.<>1__state = -1;
			<WriteGIAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteGIAsync>d__72>(ref <WriteGIAsync>d__);
			return <WriteGIAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadGO(System.UInt16,System.UInt16)" />
		// Token: 0x06000462 RID: 1122 RVA: 0x00011920 File Offset: 0x0000FB20
		[DebuggerStepThrough]
		public Task<OperateResult<ushort[]>> ReadGOAsync(ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadGOAsync>d__73 <ReadGOAsync>d__ = new FanucInterfaceNet.<ReadGOAsync>d__73();
			<ReadGOAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<ushort[]>>.Create();
			<ReadGOAsync>d__.<>4__this = this;
			<ReadGOAsync>d__.address = address;
			<ReadGOAsync>d__.length = length;
			<ReadGOAsync>d__.<>1__state = -1;
			<ReadGOAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadGOAsync>d__73>(ref <ReadGOAsync>d__);
			return <ReadGOAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WriteGO(System.UInt16,System.UInt16[])" />
		// Token: 0x06000463 RID: 1123 RVA: 0x00011974 File Offset: 0x0000FB74
		[DebuggerStepThrough]
		public Task<OperateResult> WriteGOAsync(ushort address, ushort[] value)
		{
			FanucInterfaceNet.<WriteGOAsync>d__74 <WriteGOAsync>d__ = new FanucInterfaceNet.<WriteGOAsync>d__74();
			<WriteGOAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteGOAsync>d__.<>4__this = this;
			<WriteGOAsync>d__.address = address;
			<WriteGOAsync>d__.value = value;
			<WriteGOAsync>d__.<>1__state = -1;
			<WriteGOAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteGOAsync>d__74>(ref <WriteGOAsync>d__);
			return <WriteGOAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadPMCR2(System.UInt16,System.UInt16)" />
		// Token: 0x06000464 RID: 1124 RVA: 0x000119C8 File Offset: 0x0000FBC8
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadPMCR2Async(ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadPMCR2Async>d__75 <ReadPMCR2Async>d__ = new FanucInterfaceNet.<ReadPMCR2Async>d__75();
			<ReadPMCR2Async>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadPMCR2Async>d__.<>4__this = this;
			<ReadPMCR2Async>d__.address = address;
			<ReadPMCR2Async>d__.length = length;
			<ReadPMCR2Async>d__.<>1__state = -1;
			<ReadPMCR2Async>d__.<>t__builder.Start<FanucInterfaceNet.<ReadPMCR2Async>d__75>(ref <ReadPMCR2Async>d__);
			return <ReadPMCR2Async>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WritePMCR2(System.UInt16,System.Boolean[])" />
		// Token: 0x06000465 RID: 1125 RVA: 0x00011A1C File Offset: 0x0000FC1C
		[DebuggerStepThrough]
		public Task<OperateResult> WritePMCR2Async(ushort address, bool[] value)
		{
			FanucInterfaceNet.<WritePMCR2Async>d__76 <WritePMCR2Async>d__ = new FanucInterfaceNet.<WritePMCR2Async>d__76();
			<WritePMCR2Async>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WritePMCR2Async>d__.<>4__this = this;
			<WritePMCR2Async>d__.address = address;
			<WritePMCR2Async>d__.value = value;
			<WritePMCR2Async>d__.<>1__state = -1;
			<WritePMCR2Async>d__.<>t__builder.Start<FanucInterfaceNet.<WritePMCR2Async>d__76>(ref <WritePMCR2Async>d__);
			return <WritePMCR2Async>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.ReadRDO(System.UInt16,System.UInt16)" />
		// Token: 0x06000466 RID: 1126 RVA: 0x00011A70 File Offset: 0x0000FC70
		[DebuggerStepThrough]
		public Task<OperateResult<bool[]>> ReadRDOAsync(ushort address, ushort length)
		{
			FanucInterfaceNet.<ReadRDOAsync>d__77 <ReadRDOAsync>d__ = new FanucInterfaceNet.<ReadRDOAsync>d__77();
			<ReadRDOAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadRDOAsync>d__.<>4__this = this;
			<ReadRDOAsync>d__.address = address;
			<ReadRDOAsync>d__.length = length;
			<ReadRDOAsync>d__.<>1__state = -1;
			<ReadRDOAsync>d__.<>t__builder.Start<FanucInterfaceNet.<ReadRDOAsync>d__77>(ref <ReadRDOAsync>d__);
			return <ReadRDOAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WriteRDO(System.UInt16,System.Boolean[])" />
		// Token: 0x06000467 RID: 1127 RVA: 0x00011AC4 File Offset: 0x0000FCC4
		[DebuggerStepThrough]
		public Task<OperateResult> WriteRDOAsync(ushort address, bool[] value)
		{
			FanucInterfaceNet.<WriteRDOAsync>d__78 <WriteRDOAsync>d__ = new FanucInterfaceNet.<WriteRDOAsync>d__78();
			<WriteRDOAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteRDOAsync>d__.<>4__this = this;
			<WriteRDOAsync>d__.address = address;
			<WriteRDOAsync>d__.value = value;
			<WriteRDOAsync>d__.<>1__state = -1;
			<WriteRDOAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteRDOAsync>d__78>(ref <WriteRDOAsync>d__);
			return <WriteRDOAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WriteRXyzwpr(System.UInt16,System.Single[],System.Int16[],System.Int16,System.Int16)" />
		// Token: 0x06000468 RID: 1128 RVA: 0x00011B18 File Offset: 0x0000FD18
		[DebuggerStepThrough]
		public Task<OperateResult> WriteRXyzwprAsync(ushort Address, float[] Xyzwpr, short[] Config, short UserFrame, short UserTool)
		{
			FanucInterfaceNet.<WriteRXyzwprAsync>d__79 <WriteRXyzwprAsync>d__ = new FanucInterfaceNet.<WriteRXyzwprAsync>d__79();
			<WriteRXyzwprAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteRXyzwprAsync>d__.<>4__this = this;
			<WriteRXyzwprAsync>d__.Address = Address;
			<WriteRXyzwprAsync>d__.Xyzwpr = Xyzwpr;
			<WriteRXyzwprAsync>d__.Config = Config;
			<WriteRXyzwprAsync>d__.UserFrame = UserFrame;
			<WriteRXyzwprAsync>d__.UserTool = UserTool;
			<WriteRXyzwprAsync>d__.<>1__state = -1;
			<WriteRXyzwprAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteRXyzwprAsync>d__79>(ref <WriteRXyzwprAsync>d__);
			return <WriteRXyzwprAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Robot.FANUC.FanucInterfaceNet.WriteRJoint(System.UInt16,System.Single[],System.Int16,System.Int16)" />
		// Token: 0x06000469 RID: 1129 RVA: 0x00011B84 File Offset: 0x0000FD84
		[DebuggerStepThrough]
		public Task<OperateResult> WriteRJointAsync(ushort address, float[] joint, short UserFrame, short UserTool)
		{
			FanucInterfaceNet.<WriteRJointAsync>d__80 <WriteRJointAsync>d__ = new FanucInterfaceNet.<WriteRJointAsync>d__80();
			<WriteRJointAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteRJointAsync>d__.<>4__this = this;
			<WriteRJointAsync>d__.address = address;
			<WriteRJointAsync>d__.joint = joint;
			<WriteRJointAsync>d__.UserFrame = UserFrame;
			<WriteRJointAsync>d__.UserTool = UserTool;
			<WriteRJointAsync>d__.<>1__state = -1;
			<WriteRJointAsync>d__.<>t__builder.Start<FanucInterfaceNet.<WriteRJointAsync>d__80>(ref <WriteRJointAsync>d__);
			return <WriteRJointAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc />
		// Token: 0x0600046A RID: 1130 RVA: 0x00011BE5 File Offset: 0x0000FDE5
		public override string ToString()
		{
			return string.Format("FanucInterfaceNet[{0}:{1}]", this.IpAddress, this.Port);
		}

		// Token: 0x04000131 RID: 305
		private FanucData fanucDataRetain = null;

		// Token: 0x04000132 RID: 306
		private DateTime fanucDataRefreshTime = DateTime.Now.AddSeconds(-10.0);

		// Token: 0x04000133 RID: 307
		private PropertyInfo[] fanucDataPropertyInfo = typeof(FanucData).GetProperties();

		// Token: 0x04000134 RID: 308
		private byte[] connect_req = new byte[56];

		// Token: 0x04000135 RID: 309
		private byte[] session_req = new byte[]
		{
			8,
			0,
			1,
			0,
			0,
			0,
			0,
			0,
			0,
			1,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			1,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			1,
			192,
			0,
			0,
			0,
			0,
			16,
			14,
			0,
			0,
			1,
			1,
			79,
			1,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0
		};
	}
}
